/// @tags: DPonTree
#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long LL;

int const N = 1e5 + 5, K = 1e2 + 5, mod = 1e9 + 7;

int n, k, e_cnt;
int heads[N], siz[N], f[N][K][4], g[K][4];

struct Edge {
  int v, nxt;
} e[N << 1];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void dfs(int u, int fa) {
  f[u][1][1] = f[u][0][3] = siz[u] = 1;
  for (int i = heads[u], v; i; i = e[i].nxt) {
    if ((v = e[i].v) != fa) {
      dfs(v, u);
      siz[u] += siz[v];
      memcpy(g, f[u], sizeof(g));
      for (int j = min(siz[u], k); j >= 0; --j)
        f[u][j][0] = f[u][j][1] = f[u][j][2] = f[u][j][3] = 0;
      for (int j = min(siz[u], k); j >= 0; --j) {
        for (int p = max(0, j + siz[v] - siz[u]); p <= min(siz[v], j); ++p) {
          if ((f[u][j][3] += (LL)f[v][p][2] * g[j - p][3] % mod) >= mod)
            f[u][j][3] -= mod;
          if ((f[u][j][2] +=
               (LL)(f[v][p][0] + f[v][p][2]) * (g[j - p][2] + g[j - p][3]) % mod) >= mod)
            f[u][j][2] -= mod;
          if ((f[u][j][0] += ((LL)f[v][p][0] + f[v][p][1] + f[v][p][2] + f[v][p][3]) %
                             mod * (g[j - p][1] + g[j - p][0]) % mod) >= mod)
            f[u][j][0] -= mod;
          if ((f[u][j][1] += (LL)(f[v][p][2] + f[v][p][3]) * g[j - p][1] % mod) >= mod)
            f[u][j][1] -= mod;
        }
        if ((f[u][j][0] -= f[u][j][1]) < 0) f[u][j][0] += mod;
        if ((f[u][j][2] -= f[u][j][3]) < 0) f[u][j][2] += mod;
      }
    }
  }
}

inline int main() {
  cin >> n >> k;
  for (int i = 1, u, v; i < n; ++i) {
    cin >> u >> v;
    add(u, v), add(v, u);
  }
  dfs(1, 1);
  cout << f[1][k][0] + f[1][k][2];
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P4516 [JSOI2018] 潜入行动.in", "r", stdin);
  freopen("P4516 [JSOI2018] 潜入行动.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
